-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIEM][Detections Engine] Fixed minor UI bug on all rules table pagination #59094
Conversation
…te at reducer level
…eing called, moved pagination update to that action
Pinging @elastic/siem (Team:SIEM) |
dispatch({ | ||
type: 'setRules', | ||
rules: newRules, | ||
}); | ||
dispatch({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if it will be better to add the pagination attributes in the action setRules
since we need to update the pagination each time we set the rules so we can avoid two updates in our store ( meaning we will re-render twice).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that. I did that in my second commit and then switched it to this in my latest commit. I think you're right, I should put it under setRules
since they'll go hand in hand. I can't think of a time where we would update rules and not pagination.
We will have to backport this in 7.6 branches to avoid any problem in the next release. |
…nnecessary re-renders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thank you for fixing my mistake!!!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
…ation (elastic#59094) * Fixed minor UI bug on all rules table pagination
…ation (elastic#59094) * Fixed minor UI bug on all rules table pagination
Summary
Steps to Reproduce
Go to Detections Engine --> All rules. Make sure that you have some rules added. Notice that:
Showing x rules
always appears as 0 (thanks @MadameSheema for catching this one)Changes made
Found that the 'updatePagination' action in allRulesReducer was never being used, so the
totalItemCount
property being passed for pagination was always 0. Refactored to update pagination undersetRules
action and removedupdatePagination
.Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Documentation was added for features that require explanation or tutorials- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser- [ ] This was checked for cross-browser compatibility, including a check against IE11For maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately